# -*-coding=utf-8 -*-
def Trans_foo(num_list):
    res_list = []
    cut_list = []
    list_length = len(num_list)
    num = 0
    count = 0
    # if list_length % 2 != 0:
    #     print 'the list不是2的倍数'
    #     return False
    for i in range(list_length):
    	count += 1
        if (i+1) % 3 == 0 and i > 0:
            res_list.append([num_list[i-2], num_list[i-1], num_list[i]])
            num += 1
    if count>3*num:
    	for x in range(3*num+1,count+1):
    		cut_list.append(num_list[x-1])
    	res_list.append(cut_list)
    return res_list
 
if __name__ == '__main__':
    test_num = [1,2,3,4,5,6,7,8]
    print Trans_foo(test_num)